<?php
class admin_core_Auth extends Engine_Core
{
	/**
	 * @var admin_core_Auth
	 */
	protected static $_instance;

	/**
	 * @var admin_core_Auth_Adapter
	 */
	protected $_adapter;

	/**
	 * @static
	 * @return admin_core_Auth
	 */
	public static function getInstance()
	{
		if (empty(self::$_instance)){
			self::$_instance = new self;
		}

		return self::$_instance;
	}

	/**
	 * @return admin_core_Auth_Adapter
	 */
	public function getAdapter()
	{
		return parent::getAdapter();
	}

	/**
	 * @return bool
	 */
	public function isLogged()
	{
		return $this->getAdapter()->isLogged();
	}

	/**
	 * @return void
	 */
	public function logout()
	{
		$this->getAdapter()->logout();
	}

	/**
	 * @param array $params
	 * @return bool
	 */
	public function authentificate($params = array())
	{
		return $this->getAdapter()->authentificate($params);
	}

	/**
	 * @return int
	 */
	public function getId()
	{
		return $this->getAdapter()->getId();
	}
}